package com.lin.exp02;

import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;

@EnableConfigurationProperties(CustomProperties.class)
public class Lab2AutoConfig {
    @Bean
    @ConditionalOnProperty(prefix = "wenronghui.auto",name ="enable",havingValue ="true")
    CommandLineRunner createCustomCommandLineRunner(Environment env){
        return new CustomCommandLineRunner(env);
    }
}
